#include "handle.h"

#include <cassert> // assert

#include <unistd.h> // close

#include "simple/support/enum.hpp" // support::to_integer

#include "handle_common.hpp" // custom_deleter

namespace simple::io
{
	handle close_handle_config::null() noexcept
	{ return static_cast<handle>(-1); }

	void close_handle_config::deleter(handle h) noexcept
	{
		assert(::close(support::to_integer(h)) == 0);
	}

	template class custom_deleter<close_handle_config>;

} // namespace simple::io
